from django.conf.urls.static import static
from django.conf import settings
from django.urls import path
# 网站后台
from web.views import views, chat
from web.views import loan as web_loan
from web.views import user as web_user

# Api
from web.api import user, loan, pay

urlpatterns = [

# =============================================== 网站后台 ===============================================
    path("web/index/", views.template), # 模板
    path("", views.template), # 模板
    path("web/loan/apply_list/", web_loan.apply_list), # 贷款申请
    path("web/loan/loan_list/", web_loan.loan_list),  # 放款
    path("web/user/auth_list/", web_user.auth_list),  # 用户认证
    path("web/chat/chat_room/", chat.chat_room),  # 机器人
# =============================================== 网站后台 ===============================================


# =============================================== Api ===============================================
    path("api/pay/notify/", pay.notify), # 支付回调
    path("api/pay/pay/", pay.pay), # 支付
    path("api/pay/is_pay/", pay.is_pay), # 是否支付
    path("api/user/register/", user.register), # 注册用户
    path("api/user/login/", user.login), # 登录用户
    path("api/user/smrz/", user.smrz), # 实名认证
    path("api/user/get_user_quota/", user.get_user_quota), # 获取我的额度
    path("api/user/auth_list/", user.auth_list), # 审核实名认证
    path("api/user/get_in_auth_list/", user.get_in_auth_list), # 获取需要审核的实名认证
    path("api/user/change_phone_password/", user.change_phone_password), # 修改手机号和密码

    path("api/loan/create/", loan.create_order), # 创建借款订单
    path("api/loan/select/my_order/", loan.my_order), # 查询我的订单
    path("api/loan/select/get_order/", loan.get_order), # 根据条件获取我的订单
    path("api/loan/reject/", loan.loan_reject), # 拒绝借款

    path("api/loan/loan/", loan.loan), # 审核
    path("api/loan/loan_list/", loan.loan_list), # 放款列表

# =============================================== Api ===============================================


]

urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
